package org.swim.core.manager;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.swim.local.manager.AbilityManagerLocal;
import org.swim.local.manager.CollaborationManagerLocal;
import org.swim.local.manager.FriendshipManagerLocal;
import org.swim.local.manager.UserManagerLocal;

public abstract class SwimManager {

	private static Context ic;
	
	public static AbilityManagerLocal getAml() throws NamingException
	{
		ic = new InitialContext();
		AbilityManagerLocal aml = (AbilityManagerLocal) ic
				.lookup("swim/AbilityManager/local");
		return aml;
	}
	
	public static UserManagerLocal getUml() throws NamingException
	{
		ic = new InitialContext();
		UserManagerLocal uml = (UserManagerLocal) ic
				.lookup("swim/UserManager/local");
		return uml;
	}
	
	public static FriendshipManagerLocal getFml() throws NamingException
	{
		ic = new InitialContext();
		FriendshipManagerLocal fml = (FriendshipManagerLocal) ic
				.lookup("swim/FriendshipManager/local");
		return fml;
	}
	
	public static CollaborationManagerLocal getCml() throws NamingException
	{
		ic = new InitialContext();
		CollaborationManagerLocal cml = (CollaborationManagerLocal) ic
				.lookup("swim/CollaborationManager/local");
		return cml;
	}
}
